#include"function actualize.h"
#include "stdafx.h"
bool InsertLNode(LinkList *pLink, ElemType e)
{
	Link p = pLink->head;
	Link ins = (Link)malloc(sizeof(LNode));
	if (!ins) { cout << "ERROR!"; }
	ins->data = e;
	if (p->next = NULL) { p->next = ins; ins->next = NULL; pLink->end = ins; return EXIT_SUCCESS; }
	while (p->next->data.power < e.power)
	{
		if (p->next->next = NULL)break;
		p = p->next;
	}

	if (p->next->next = NULL) { p->next->next = ins; ins->next = NULL; pLink->end = ins; return EXIT_SUCCESS; }
	else { ins->next = p->next; p->next = ins; return EXIT_SUCCESS; }
	return EXIT_FAILURE;
}